<!-- 场景:浮动元素会脱标,如果父级没有高度,子级无法撑开父级高度(可能导致页面布局错乱) -->
<!-- 解决方法:清除浮动(清除浮动带来的影响) -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动</title>
    <style>
        .top {
            margin: 10px auto;
            width: 1200px;
            /* height: 300px; */
            background-color: pink;
        }

        .left {
            width: 200px;
            height: 300px;
            background-color: skyblue;

            float: left;
        }

        .right {
            width: 950px;
            height: 300px;
            background-color: orange;

            float: right;
        }

        .bottom {
            height: 100px;
            background-color: brown;
        }
    </style>
</head>
<body>
    <div class="top">
        <div class="left"></div>
        <div class="right"></div>
    </div>
    <div class="bottom"></div>
</body>
</html>